
             
/**
 * 
 *
 * @File name:  GetTSuppliersAction.java   根据主键查询【供应商信息:T_SUPPLIERS】
 * @Create on:  2011-10-31 23:59:947
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.suppliers.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.po.DynaBeanMap;
import cn.boho.framework.service.MessageService;

import com.boho.estates.suppliers.common.Constant;
import com.boho.estates.suppliers.dao.TSuppliersDao;

public class GetTSuppliersAction extends ActionImp {
	
	private String exception = "";
	private String suppliersType = "";
	
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if(Constant.SUPPLIERS_TYPE_X.equalsIgnoreCase(suppliersType)){
			exception = Constant.X_EXCEPTION;
		}
		else if(Constant.SUPPLIERS_TYPE_Z.equalsIgnoreCase(suppliersType)){
			exception = Constant.Z_EXCEPTION;
		}
		atx.setErrorContext("BOHO_COMMON_1004", MessageService.getMessage("BOHO_COMMON_1004"),exception, ex);
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Integer suppliersNo = atx.getIntegerValue("SUPPLIERS_NO",-1);
		DynaBeanMap dbm = TSuppliersDao.getTSuppliersByPk(con,suppliersNo);
		atx.setObjValue("T_SUPPLIERS", dbm);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		return 1;
	}
}
